<script>
function addAnImage(){
	$("#imageUploadDiv").append("<input  type=file	name=uploadImages[] />");
}
function removeImage(id){
	$("#imageDisplayDiv").append("<input  type='hidden'	name='deleteImages[]' value="+id+" />");
	$("#imageDisplayDiv"+id).remove();
}
</script>

<div class='div'>
	<div class='div' style='margin: 12px'>
		<h1>
			<?php 
			$event = Event::model()->find("album_id = $album->id");
			$member = Member::model()->findByPk($event->member_id);
			echo CHtml::link($_GET['album_title'],array("event/view","id"=>$event->id,"username"=>$member->username)) ?>
			- 相册管理
		</h1>
	</div>
	<hr />
	<?php echo CHtml::form('','post',array('enctype'=>'multipart/form-data',"data-ajax"=>"false")); ?>

	<div id='imageDisplayDiv' class='div' style='margin: 12px'>
		<?php foreach ($images as $image):?>
		<div id='imageDisplayDiv<?php echo $image->id?>' class='span2'
			style='text-align: center; height: 150px;'>
			<div style='height: 100px;'>
				<?php echo CHtml::image(Utils::getImageUrlById("album", "thumbnail", $image->id),"",array("class"=>'thumbnail','style'=>'margin:auto'));?>
			</div>
			<br /> <a class='btn btn-danger'
				onclick='removeImage(<?php echo $image->id?>)'> <i
				class='icon-remove icon-white'></i> 删除
			</a>
		</div>
		<?php endforeach; ?>
		<div style='clear: both'></div>
	</div>
	<hr />
	<div id='imageUploadDiv' class='div'></div>

	<div class='div'>
		<a class='btn btn-warning' onclick='addAnImage()'>增加一张图片</a> <input
			type='submit' class='btn btn-primary' value='确定以上操作' />
	</div>

	<?php echo CHtml::endForm(); ?>
</div>
